package net.haier.fashion.trend.report.core.exception;

import lombok.Getter;
import net.haier.fashion.trend.report.core.common.enums.HttpReturnEnums;
import net.haier.fashion.trend.report.core.common.enums.IEnum;

@Getter
public class ServiceException extends RuntimeException {


    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code = HttpReturnEnums.SYSTEM_ERROR.getValue();

    private Object data;

    public ServiceException() {
        super();
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, Object data) {
        super(message);
        this.data = data;
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(IEnum iEnum) {
        super(iEnum.getDesc());
        this.code = iEnum.getValue();
    }



}
